<?php 
/**
 * 等级代练产品模板
 */
?>
<form class="form-horizontal pl-box">
    <input type="hidden"  name="server" id="serverText-value"/>
    <input type="hidden"  name="game" value="<?php echo $model->game_id; ?>"/>
    <input type="hidden"  name="product_type" value="PL"/>
    <div class="control-group">
        <label class="control-label">Server: </label>
        <div class="controls">
            <input type="text" class="PL_lis2 PL_lisc" id="serverText"/>
            <div id="servers" class="selectItemhidden">
                <div id="selectItemAd" class="selectItemtit bgc_ccc"> 
                    <h2 id="selectItemTitle" class="selectItemleft"></h2> 
                    <div id="selectItemClose" class="selectItemright">×</div>
                </div>
                <div id="selectItemCount" class="selectItemcont"> 
                    <div id="selectServer" class="fitler-list"> 
                        <ul class="sub_li">
                            <?php
                            foreach ($game_servers as $sdata) {
                                $fliterClass = strtoupper(substr($sdata->title, 0, 1));
                                echo "<li  class='" . $fliterClass . "'><a rel='" . $sdata->id . "' title='" . $sdata->title . "'>" . $sdata->title . "</a></li>";
                            }
                            ?>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="control-group">
        <?php
        $this->widget('ext.selectdiv.selectdivWidget', array(
            'slider_id' => 'serverText',
            'slider_content' => 'servers',
            'selectSub' => 'selectServer',
            'type' => 'pl',
        ));
        ?>
    </div>
    <div class="control-group">
        <label class="control-label" style="line-height: 66px;">Power Level:</label>
        <div class="controls">
            <?php
            //获取最大，最小等级
            $mLevel = ProductPowerleveling::model()->getMaxMinLevel($model->game_id);
            $tmax = $mLevel->maxlevel - 10;
            $tmin = $mLevel->minlevel + 10;
            $oprice = ProductPowerleveling::model()->getPowerlevelPH($model->game_id, $tmin, $tmax);
            ?>
            <div class="show-level">
                Lv : <input type="text" id="start_level" name="start_level" class="input-small" size="5" value="<?php echo $tmin ?>" onblur="changeLevel(this)"> 
                - 
                Lv : <input type="text" id="end_level" name="end_level"  class="input-small" value="<?php echo $tmax ?>" size="5" onblur="changeLevel(this)">
            </div>
            <hr style="margin:10px 0;"/>
            <div id="slider-range"></div>
            <?php
            $this->widget('ext.selectSlider.selectSliderWidget', array(
                'reqUrl' => Yii::app()->createAbsoluteUrl('category/api', array('action' => 'PLP', 'game_id' => $model->game_id)),
                'value' => $tmin . "," . $tmax,
                'max' => $mLevel->maxlevel,
                'min' => $mLevel->minlevel,
            ));
            ?>
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">Total Price:</label>
        <div class="controls">
            <input class="span2" disabled id="show_price" value="<?php $tPrice = $this->changeCurrency($oprice['pl_price']); echo implode('', $tPrice); ?>" type="text">
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">Hours:</label>
        <div class="controls">
            <input class="span2" disabled type="text" id="show_hour" value="<?php echo round($oprice['pl_time'], 2) ?>" />
        </div>
    </div>
    <div class="pull-right">
        <input rel="add" type="button" class="add-to-cart getAttr btn" value="Add To Cart" id="addtocart">
        <input rel="buy" type="button" class="buy-now getAttr btn btn-primary" value="Buy Now" id="buy_now" >
    </div>
    <div class="clearfix"></div>
</form>

<hr/>
<?php echo $model->info; ?>

